package com.alibaba.aone.casestudy.module.screen;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.aone.casestudy.common.entity.Failure;
import com.alibaba.aone.casestudy.common.entity.FailureRpAsignGroup;
import com.alibaba.aone.casestudy.common.entity.FailureTime;
import com.alibaba.aone.casestudy.service.FailureService;
import com.alibaba.aone.casestudy.service.FailureTimeService;
import com.alibaba.aone.casestudy.service.GroupService;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.dataresolver.Param;




/**
 * 类FailureDetailView.java的实现描述：TODO 类实现描述 
 * @author yongchun.chengyc 2011-4-26 下午08:46:16
 */
public class FailureDetailEdit {
	
	@Autowired
	private FailureService failureService;
	@Autowired
	private GroupService groupService;
	@Autowired
	private FailureTimeService failtureTimeService;
	
	
	public void execute(@Param("number")String number,Context context){
		
		Failure failure = failureService.getFailureByNumber(number);
		List<FailureRpAsignGroup> groups =groupService.getGroups(number);
		List<FailureTime> timeList = (List<FailureTime>) failtureTimeService.getFailureTime(number);
		
		context.put("failure", failure);
		context.put("groups",groups);
		context.put("timeList",timeList);
	}
}
